#pragma once
#include <iostream>
#include <random>

void random_fill(double *data, int size) {
    std::random_device rd;
    std::mt19937 gen(rd());
    std::uniform_int_distribution<> distrib(0, 10);
    for (int i = 0; i < size; i++) {
        data[i] = distrib(gen);
    }
}

void zero_fill(double *data, int size) {
    for (int i = 0; i < size; i++) {
        data[i] = 0;
    }
}

bool equal(double *data1, double *data2, int size) {
    for (int i = 0; i < size; i++) {
        if (abs(data1[i] - data2[i]) > 1e-5) {
            std::cout << data1[i] << " != " << data2[i] << std::endl;
            return false;
        }
    }
    return true;
}

void print(double *data, int M, int N) {
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < N; j++) {
            std::cout << data[i + j * M] << "\t";
        }
        std::cout << std::endl;
    }
    std::cout << "----------" << std::endl;
}
